<?
	
    session_start();	
	if ($_SESSION['log']!='SI'){
		$_SESSION['redirigirA']="../Reservas/reservarXfecha.php";
		header("location: ../Usuarios/login.php");		
	}else{
        include('../modelo/conexion.php');	
	    include('../modelo/canchas.php');		
	    include('../modelo/utils.php');		
	    include('../Inicio/cabeza.php');		        
		
	?>		
<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			imgPath:"../../jsdatepick-calendar/img/",
			yearsRange:[2011,2030],
			target:"dia",
			cellColorScheme:"armygreen",
			dateFormat:"%d-%m-%Y"
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,			
			dateFormat:"%m-%d-%Y",			
			weekStartDay:1*/
		});
	};
</script>


            <form name="frm_reservar" id="frm_reservar" action="Reservas/reservar.php" method="post">
                    <table cellpadding="1" cellspacing="1">
                            <tbody>
                                    <tr>
                                            <td width="86">							
                                                            F&uacute;tbol                                            </td>
                                            <td width="195">
                                                <?
                                                /*<select name="tipo_cancha" id="tipo_cancha"><option selected="selected" value="5">5</option><option value="7">7</option><option value="8">8</option><option value="11">11</option></select>*/
                                                $con = new Conexion();
                                                $con->Conectarse();
                                                $cancha=new Cancha();
                                                $tipos = $cancha->select_tipos($con);
                                                $con->DesConectarse();
                                                if (count($tipos)>0){
                                                    echo '<select name="tipo_cancha" id="tipo_cancha">';
                                                    while($row=mysql_fetch_array($tipos)){	
                                                        $tipo=$row['tipo'];
                                                        $tipo=$tipo['tipo'];
                                                        if ($tipo=='5'){
                                                            echo '<option selected="selected" value="5">5</option>';
                                                        }else{
                                                            echo '<option value="'.$tipo.'">'.$tipo.'</option>';
                                                        }
                                                    }
                                                    echo '</select>';
                                                }else{
                                                    echo "error al cargar tipos de cancha";
                                                } 
                                                ?>                                            </td>
                                    </tr>
                                    <tr>
                                            <td>
                                                    D&iacute;a</td>
                                            <td>
                                                <input type="text" size="12" id="dia" value="<? echo get_hoy('d-m-Y');?>"/></td>
                                    </tr>
                                    <!--
                                            <tr>
                                            <td>
                                                    Hora</td>
                                            <td>
                                                    <select name="hora">
                                    <option value="-1">[Cualquiera]</option><option value="9">09:00</option><option value="10">10:00</option><option value="11">11:00</option><option value="12">12:00</option><option value="13">13:00</option><option value="14">14:00</option><option value="15">15:00</option><option value="16">16:00</option><option value="17">17:00</option><option value="18">18:00</option><option value="19">19:00</option><option value="20">20:00</option><option value="21">21:00</option><option value="22">22:00</option><option value="23">23:00</option>
                            </select>
                                                    &nbsp;</td>
                                    </tr>
                                    -->
                                    <tr>
                                      <td>Turno</td>
                                      <td >&nbsp;</td>
                                    </tr>
                                    <tr>
                                      <td>Departamento</td>
                                      <td >&nbsp;</td>
                                    </tr>
                                    <tr>
                                      <td>Ciudad</td>
                                      <td >&nbsp;</td>
                                    </tr>
                                    <tr>
                                      <td>Zona</td>
                                      <td >&nbsp;</td>
                                    </tr>
                                    <tr>
                                            <td>&nbsp; </td>
                                            <td ><input type="button" value="Mostrar" name="boton" onclick="listarReservasXDiasXTipo()"></td>
                                    </tr>

                                    <tr>
<!--                            <td><a href='javascript:listarReservasXDiasXTipoAnterior()'><-</a></td>
                        <td><a href='javascript:listarReservasXDiasXTipoSiguiente()'>-></a></td>-->
                        </tr>
                            </tbody>
                    </table>
</form>

            <div id="listado_reservas">


            </div>


    <?		

            include('../Inicio/pie.php');
    }

?>


